<!-- Edit Notification -->
<g:set var="title" value="Edit Notification for &nbsp;${notification.company}" />
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main" />
  <title>${title}</title>
</head>
<body>
  <div class="body">
    <h1>${title}</h1>
    <g:render template="/common/flashMessage" />
    <g:render template="/common/beanError" model="[bean:notification]" />
    <g:form method="post" >
      <div class="dialog">
        <table><tbody>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="rep">Representative:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean:notification, field:'rep','errors')}">
              <g:select optionKey="id" from="${Representative.list()}" name="rep.id" value="${notification?.rep?.id}" ></g:select>
            </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="contact">Contact:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean:notification, field:'contact','errors')}">
              <g:select optionKey="id" from="${notification.company.contacts}" name="contact.id" value="${notification?.contact?.id}" ></g:select>
            </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="salesPerson">Call Type:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean:officeCall, field:'type','errors')}">
              <g:select optionKey="id" from="${OfficeCallType.list()}" name="type.id" noSelection="${['null':' ']}" />
            </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="date">Notification Date:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean:notification, field:'date','errors')}">
              <g:datePicker name="date" value="${notification?.date}" precision="minute" ></g:datePicker>
            </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="reason">Reason:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean:notification,field:'reason','errors')}">
              <textarea rows="2" cols="40" name="reason">${fieldValue(bean:notification, field:'reason')}</textarea>
            </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="reason">Result:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean:notification,field:'result','errors')}">
              <textarea rows="2" cols="40" name="reason">${fieldValue(bean:notification, field:'result')}</textarea>
            </td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name">
              <label for="notes">Notes:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean:notification,field:'notes','errors')}">
              <textarea rows="3" cols="40" name="notes">${fieldValue(bean:notification, field:'notes')}</textarea>
            </td>
          </tr>
        </tbody></table>
      </div>
      <input type="hidden" name="id" value="${notificationInstance?.id}" />
      <input type="hidden" name="version" value="${notificationInstance?.version}" />
      <input type="hidden" name="returnAction" value="edit" />
      <tdcmw:submitFormButton action="show" label="Cancel" />
      <tdcmw:submitFormButton action="notifyNow" label="Notify Now" />
      <tdcmw:submitFormButton action="update" label="Update" />
      <tdcmw:submitFormButton action="complete" label="Complete" />
    </g:form>
  </div>
</body>
